<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): Installation</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_c_api_installation.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Installation</div>  </div>
</div><!--header-->
<div class="contents">
<dl class="section user"><dt>Compatibilities</dt><dd></dd></dl>
<p>Actual version of OCILIB has been validated on :</p><ul>
<li>Platforms: Windows, HP/UX, Linux, Mac OS, Solaris, AIX</li>
<li>Architectures: 32/64bits</li>
<li>Compilers: GCC / MinGW, MS Compilers, IBM XLC, CCs, LabView</li>
<li>Oracle versions: 8i, 9i, 10g, 11g</li>
</ul>
<p>Please, contact the author if you have validated OCILIB on platforms or compilers not listed here.</p>
<dl class="section user"><dt>Global build options</dt><dd></dd></dl>
<p>OCILIB supports the following global build options:</p>
<p>=&gt; Oracle import modes</p>
<ul>
<li>OCI_IMPORT_LINKAGE for linkage at compile time (default on Unix systems)</li>
<li>OCI_IMPORT_RUNTIME for runtime loading (default with prebuilt OCILIB libraries on MS Windows)</li>
</ul>
<p>=&gt; Oracle charset modes</p>
<ul>
<li>OCI_CHARSET_ANSI : ANSI strings or UT8 strings (default)</li>
<li>OCI_CHARSET_WIDE : wide strings using ISO C wide character</li>
</ul>
<p>=&gt; Calling convention (WINDOWS ONLY)</p>
<ul>
<li>OCI_API = __cdecl or blank for C/C++ only ! (default on Unix systems and non MSVC projects)</li>
<li>OCI_API = __stdcall to link OCILIB shared library on Ms Windows (default for MSVC projects)</li>
</ul>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>On Windows, OCI_API MUST be set to __stdcall in order to use prebuilt libraries The header file "ocilib.h" automatically sets OCI_API to __stdcall with MS compilers</p>
<dl class="section user"><dt>Installing OCILIB on UNIX like systems</dt><dd></dd></dl>
<p>OCILIB uses GNU autotools for deployment and installation on UNIX like platforms</p>
<p>Uncompress the archive (ocilib-x.y.z-gnu.tar.gz)</p><ul>
<li>$ cd ocilib-x.y.z</li>
<li>$ ./configure</li>
<li>$ ./make</li>
<li>$ ./make install (this step might require admin rights)</li>
</ul>
<p>Check the shared library path environment variable (LD_LIBRARY_PATH, LD_PATH, ...):</p><ul>
<li>it must include $ORACLE_HOME[lib|lib32|lib64]</li>
<li>it must include the path where OCILIB has been installed (by example, typically /usr/local/lib under Linux)</li>
</ul>
<p>In order to get these values loaded at logon time, export these values in your .profile configuration file :</p><ul>
<li>&gt; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/local/lib</li>
</ul>
<p><b>GNU Installation options </b>:</p>
<p>OCILIB supports some options that are not needed for most common configurations.</p>
<p>List of available options:</p>
<ul>
<li>&ndash;with-oracle-import=(linkage|runtime)</li>
<li>&ndash;with-oracle-charset=(ansi|wide)</li>
<li>&ndash;with-oracle-home=(custom oracle regular client directory)</li>
<li>&ndash;with-oracle-headers-path=(oracle header files directory)</li>
<li>&ndash;with-oracle-lib-path=(oracle shared lib directory)</li>
<li>&ndash;with-oracle-lib-name=(oracle shared lib name)</li>
<li>&ndash;with-custom-loader=(linker flag telling the linker which loader to use when loading dynamically at runtime Oracle shared libs. This option must be provide if the platform does not use the default loader flag '-ldl') and the &ndash;with-oracle-import is set to 'runtime'</li>
</ul>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>&ndash;with-oracle-headers-path and &ndash;with-oracle-lib-path are meant to be used with Instant client only but can used for regular client of libs and headers are not located in usual folders</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>If the Oracle OCI linkage mode is set to 'linkage' (default) and no Oracle lib path is provided, OCILIB configure script tries to located the Oracle library folder following this sequence :</p><ul>
<li>$ORACLE_HOME/lib32 (32 bits libs)</li>
<li>$ORACLE_HOME/lib (32 or 64 bits libs)</li>
<li>$ORACLE_HOME/lib64 (64 bits libs)</li>
</ul>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>To compile native 64 bits versions of OCILIB, you need pass your compiler specifics flags to the configure script.</p>
<p>To use OCILIB in a project:</p>
<ul>
<li>include "ocilib.h" in your application</li>
<li>Add the flag -I$USER_LIBS/include to your compiler</li>
<li>Defines OCILIB modes:<ul>
<li>OCI import mode (-DOCI_IMPORT_LINKAGE | -DOCI_IMPORT_RUNTIME)</li>
<li>OCI charset mode (-DOCI_CHARSET_ANSI | -DOCI_CHARSET_WIDE)</li>
</ul>
</li>
<li>Add the flag -L/$ORACLE_HOME/[lib|lib32|lib64] -lclntsh to the linker</li>
<li>Add the flag -L$USER_LIBS/lib -locilib to the linker</li>
</ul>
<p>where :</p><ul>
<li>$USER_LIBS is the folder where OCILIB was installed</li>
<li>$ORACLE_LIB_PATH is Oracle client shared library path</li>
</ul>
<p>Some older version of Oracle 8 have direct path API symbols located in the library libclient8. With these versions, you must include as well the linker flag -lclient8 to use Direct Path API.</p>
<dl class="section user"><dt>Installing and using OCILIB on Microsoft Windows</dt><dd></dd></dl>
<p>32bits and 64bits DLLs are provided for x86 architectures. Microsoft Visual Studio solutions (2005, 2008, 2010 and 2013) are also provided to recompile the Dlls and the demo.</p>
<ul>
<li>Uncompress the archive (ocilib-x.y.z-windows.zip)</li>
<li>Copy <a class="el" href="ocilib_8h_source.html">ocilib/include/ocilib.h</a> to a folder listed in the compiler headers folders</li>
<li>Copy ocilib/lib[32|64]/ocilib[x].lib to a folder listed in the linker libraries folders</li>
<li>Copy ocilib/lib[32|64]/ocilib[x].dll to a folder included in the PATH environment variable</li>
</ul>
<p>[x] is the compiled version of OCILIB ('a' -&gt; ANSI, 'w' -&gt; Wide character, e.g. Unicode)</p>
<p>To use OCILIB in a project :</p>
<ul>
<li>include "ocilib.h" in your application</li>
<li>define call convention (OCI_API) to __stdcall</li>
<li>define charset mode (OCI_CHARSET_ANSI | OCI_CHARSET_WIDE)</li>
</ul>
<p>Note for MinGW users:</p><ul>
<li>Precompiled 32bits static libraries libocilib[x].a are provided</li>
<li>To use OCILIB dll's, copy/rename import libraries ocilib[x].lib to libocilib[x].lib</li>
<li>Add the desired version (static/shared + charset) of the library to the linker options</li>
</ul>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>The OCI import mode (OCI_IMPORT_LINKAGE or OCI_IMPORT_RUNTIME is only used when compiling OCILIB source code</p>
<dl class="section user"><dt>Oracle Instant Client Support</dt><dd></dd></dl>
<p>OCILIB supports Oracle Instant Client.</p>
<p>On Microsoft Windows, there is no difference between using a regular Oracle client and an Instant Client with OCILIB</p>
<p>On Unix-like systems, the Instant Client is divided in different packages.</p>
<p>Public headers and shared libs are not part of the same package.</p>
<p>So, you must provide the following options to the configure command:</p>
<ul>
<li>with-oracle-headers-path: location the public header files</li>
<li>with-oracle-lib-path: location the oracle shared lib</li>
</ul>
<p>If your instant client package containing the shared libs does not have a symbolic link 'libclntsh.[shared lib extension]' to the fully qualified shared lib real name, you must create it:</p>
<p>Example on Linux:</p>
<ul>
<li>$ ln -s $ORALIBPATH/libclntsh.so.10.1 $ORALIBPATH/libclntsh.so </li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:36 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
